package com.atguign.gulimall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: gulimall
 * @description: 分布式锁配置
 * @author: liuxvru
 * @create: 2024-03-10 17:44
 **/
@Configuration
public class MyRedssionConfig {
    @Bean(destroyMethod = "shutdown")
    RedissonClient redisson(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.74.128:6379");
        return Redisson.create(config);
    }
}
